import 'package:get/get.dart';
import 'package:scaffold/controller/base/BaseController.dart';
import 'package:scaffold/state/login/LoginState.dart';
import 'package:scaffold/util/TranslationHelper.dart';

import '../../ui/widget/InputComponent.dart';

class LoginController extends BaseController<LoginState>{
  @override
  LoginState initState() {
    return LoginState();
  }

  void onObscureToggled(Rx<InputModel> model){
    model.update((input){
      input?.showPwd = !input.showPwd;
    });
  }

  void switchLang(){
    TranslationHelper.switchLang(
        languageIndex: TranslationHelper.language == 0 ? 1 : 0);
  }

}